<script setup lang="ts">
import {EDesigner} from "@/components/formdesigner";
import {defineExpose, ref} from "vue";

const designer = ref();

function onSave(e) {

}

function setData(d) {
  designer.value.setData(d);
}

function getData() {
  let val = designer.value.getData();
  return val;
}

function onReset(e) {
}

function handleReset() {
  let val = designer.value.reset();
  return val;
}

function toggleDeviceMode(e) {
}

// watch(() => defaultSchema.value, (newVal) => {
//   console.log("defaultSchema:",newVal)
// })
defineExpose({
  getData,
  setData,
  handleReset
})
// designer.value.setData();
</script>

<template>
  <div class="h-full">
    <EDesigner ref="designer" @save="onSave" @reset="onReset" @toggleDeviceMode="toggleDeviceMode"
               :hiddenHeader="true"
    />
  </div>
</template>

<style scoped>
.h-full {
  height: 100%;
}
</style>
